package interface_graphique;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import javax.imageio.ImageIO;
import javax.swing.JComponent;


class PersistentCanvas extends JComponent {
	 
	private static final long serialVersionUID = 1L;
	 
	int x, y, cote = 20;
	private BufferedImage img,reserve,menu;
	
	
	PersistentCanvas() {
		 try {
			img = ImageIO.read(new File("image/contaminee.png"));
			reserve = ImageIO.read(new File("image/reserve.png"));
			menu = ImageIO.read(new File("image/retour.png"));
		} catch (IOException e) {
			e.printStackTrace();
		}	
		 
	}

	public void paint(Graphics graphics) {
		Graphics2D g = (Graphics2D) graphics;
		g.setColor(getBackground());
		g.fillRect(0, 0, getWidth(), getHeight());
		int x=0,y=0;
		
		Font font = new Font("Arial", Font.BOLD, 15);
		g.setColor(Color.WHITE);
		g.setFont(font);
		
		
		//Affichage du niveau en cours 
		 
		g.drawImage(reserve,0,15,null);
		g.drawImage(menu,250,25,null);
		
		
				
				x= 20;
				y=30;
				
						
					g.drawImage(img, x,y, null);
				
				
				g.setColor(new Color(49,149,221));
				
			
		
			 
		
	}	

}